<?php
class uvmcSolrService extends Apache_Solr_Service
{
  public function deleteByIds($ids, $fromPending = true, $fromCommitted = true, $timeout = 3600)
  {
    $pendingValue = $fromPending ? 'true' : 'false';
    $committedValue = $fromCommitted ? 'true' : 'false';
    
    $rawPost = '<delete fromPending="' . $pendingValue . '" fromCommitted="' . $committedValue . '">';
    foreach ($ids as $id) {
      //escape special xml characters
      $id = htmlspecialchars($id, ENT_NOQUOTES, 'UTF-8');
      
      $rawPost .= '<id>' . $id . '</id>';
    }
    $rawPost .= '</delete>';
    
    return $this->delete($rawPost, $timeout);
  }
}
